﻿<%@ Page Language="C#" AutoEventWireup="true" Theme="Default" CodeBehind="CaiGuanJZXD.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS._8.QiTaGL.CaiGuanJZXD" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>采灌井征询单</title>
    <script src="/JS/AddEditCancel.js"></script>
    <script src="/JS/jquery.js"></script>
    <script type="text/javascript">
        var typenum = 1;
        //开始上传文件
        function Uploader_OnUploadStart() {
            //验证文件类型
            BtnDR.SetEnabled(false);
        }
        var times = 0;
        function Uploader_OnFilesUploadComplete(args) {

            if (args.isValid) {
                if (parseInt(args.callbackData) < 0) {
                    alert('文件上传失败');
                    BtnDR.SetEnabled(false);
                }
                else if (parseInt(args.callbackData) == 10) {
                    BtnDR.SetEnabled(false);
                    alert(args.callbackData.split('|')[1]);
                }
                else {

                    BtnDR.SetEnabled(true);
                    txtPath.SetText(args.callbackData.split('|')[0]);
                    HidList.Set("path", args.callbackData.split('|')[1]);
                    HidList.Set("IsHave", args.callbackData.split('|')[2]);
                    return;
                }
            }
        }

        function BindList() {
            if (txtYear.GetText() == "") {
                alert("年度不能为空");
                txtYear.Focus();
                return;
            }
            if (txtRQ.GetText() == "") {
                alert("最后返回日期不能为空");
                txtRQ.Focus();
                return;
            }
            if (txtDYRQ.GetText() == "") {
                alert("打印日期不能为空");
                txtDYRQ.Focus();
                return;
            }
            btnBindRight.OnClick();
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div>
                    <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="LoadPanel" runat="server" Modal="true" Theme="Metropolis" ShowImage="false" Text="加载中"></dx:ASPxLoadingPanel>

                    <div class="tabletitle1" align="center">
                        采灌井征询单
                    </div>
                    <table style="width: 100%">
                        <tr>
                            <td style="width: 50px" align="right">年度：
                            </td>
                            <td style="width: 220px">
                                <dx:ASPxTextBox ID="txtYear" Width="100%" ClientInstanceName="txtYear" runat="server">
                                </dx:ASPxTextBox>
                                <dx:ASPxHiddenField ID="HidList" ClientInstanceName="HidList" runat="server"></dx:ASPxHiddenField>
                            </td>

                            <td style="width: 90px" align="right">最后返回日期：</td>
                            <td style="width: 150px">
                                <dx:ASPxDateEdit ID="txtRQ" DisplayFormatString="yyyy年MM月dd日" ClientInstanceName="txtRQ" runat="server" Width="100%">
                                </dx:ASPxDateEdit>
                            </td>
                             <td style="width: 80px" align="right">打印日期：
                                    </td>
                                    <td style="width: 200px">
                                        <dx:ASPxDateEdit ID="txtDYRQ" DisplayFormatString="yyyy年MM月dd日" ClientInstanceName="txtDYRQ" runat="server" Width="150px">
                                        </dx:ASPxDateEdit>
                                    </td>
                            <td>
                                <dx:ASPxButton ID="ASPxButton1" ClientInstanceName="BtnDR" runat="server" Text="查询" AutoPostBack="false"
                                    UseSubmitBehavior="false">
                                    <ClientSideEvents Click="function(s,e){BindList();}" />
                                </dx:ASPxButton>

                            </td>
                        </tr>

                    </table>
                    <div style="display: none">
                        <dx:ASPxButton ID="btnBindRight" OnClick="btnBindRight_Click" ClientInstanceName="btnBindRight" runat="server" Text="查询"
                            UseSubmitBehavior="false">
                            <ClientSideEvents Click="function(s,e){LoadPanel.SetText('正在查询...');LoadPanel.Show();}" />
                        </dx:ASPxButton>

                    </div>
                    <div id="divList" align="center">
                        <div>
                            <table style="width: 100%">
                                <tr>

                                    <td style="width: 30%" valign="top">
                                        <dx:ASPxGridView ID="gvList" ClientInstanceName="gvList" runat="server" KeyFieldName="S_YONGHUH" Theme="Aqua1" Width="100%">
                                            <Columns>

                                                <dx:GridViewDataTextColumn Caption="选择"  CellStyle-HorizontalAlign="Center" Width="5%">
                                                    <DataItemTemplate>
                                                        <asp:HiddenField ID="hid" runat="server" Value='<%#Eval("S_YONGHUH") %>' />
                                                        <asp:HiddenField ID="S_YONGHUM" runat="server" Value='<%#Eval("S_YONGHUM") %>' />
                                                        <asp:HiddenField ID="S_DIZHI" runat="server" Value='<%#Eval("S_DIZHI") %>' />
                                                        <asp:HiddenField ID="S_YOUBIAN" runat="server" Value='<%#Eval("S_YOUBIAN") %>' />

                                                         <asp:HiddenField ID="FANHUIRQ" runat="server" Value='<%#Eval("FANHUIRQ") %>' />
                                                         <asp:HiddenField ID="DAYINRQ" runat="server" Value='<%#Eval("DAYINRQ") %>' />
                                                         <asp:HiddenField ID="I_Y" runat="server" Value='<%#Eval("I_Y") %>' />
                                                         
                                                        <dx:ASPxCheckBox ID="cid" runat="server"></dx:ASPxCheckBox>
                                                    </DataItemTemplate>

                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="S_YONGHUH" Caption="用户号" Width="10%">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="S_YONGHUM" Caption="用户名" Width="25%">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="I_Y" Caption="年" Width="5%">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="FANHUIRQ" Caption="返回日期" Width="10%">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="DAYINRQ" Caption="打印日期" Width="10%">
                                                </dx:GridViewDataTextColumn>                                                
                                                <dx:GridViewDataTextColumn FieldName="S_YOUBIAN" Caption="邮政编码" Width="10%">
                                                </dx:GridViewDataTextColumn>
                                                <dx:GridViewDataTextColumn FieldName="S_DIZHI" Caption="用户地址" Width="25%">
                                                </dx:GridViewDataTextColumn>
                                            </Columns>

                                            <Settings VerticalScrollableHeight="315" VerticalScrollBarMode="Auto" />
                                            <ClientSideEvents Init="function(s,e){AdjustSize(130,gvList);}" />
                                        </dx:ASPxGridView>
                                    </td>


                                </tr>

                            </table>
                            <table style="width: 100%">
                              <%--  <tr>
                                   
                                    <td style="width: 200px" align="center">
                                        <span style="color: red">查询前请先选择正确的打印日期

                                        </span>
                                    </td>
                                    <td></td>
                                </tr>--%>
                                <tr>
                                    <td></td>
                                    <td runat="server" id="pagetotal" valign="middle" style="height: 30px"></td>
                                    <td align="center">
                                        <dx:ASPxButton ID="btnQX" ClientInstanceName="btnQX" OnClick="btnQuanXuan_Click" runat="server" Text="全选" AutoPostBack="false"
                                            UseSubmitBehavior="false">
                                        </dx:ASPxButton>
                                        <dx:ASPxButton ID="btnQuXiao" ClientInstanceName="btnQuXiao" OnClick="btnFanXuan_Click" runat="server" Text="取消" AutoPostBack="false"
                                            UseSubmitBehavior="false">
                                            
                                        </dx:ASPxButton>
                                    </td>
                                    <td align="center">
                                        <dx:ASPxButton ID="btnExcel" ClientInstanceName="btnExcel" runat="server" Text="导出EXCEL"  OnClick="btnExcel_Click"
                                            UseSubmitBehavior="false">
                                           
                                        </dx:ASPxButton>
                                        <dx:ASPxButton ID="btnDaYin" ClientInstanceName="btnDaYin" OnClick="btnDaYin_Click" runat="server" Text="打印" AutoPostBack="false"
                                            UseSubmitBehavior="false">
                                           
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </div>

                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
